package Res;
import java.util.HashMap;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Texture;
public class TextureMgr 
{
	protected HashMap<String, Texture> texturecache = new HashMap<String, Texture>();
	
	static protected TextureMgr _inst = new TextureMgr();
	
	static public TextureMgr GetInst()
	{
		return _inst;
	}
	
	public Texture GetTexture(String strTex)
	{
		Texture texture = texturecache.get(strTex);
		if (texture != null)
		{
			return texture;
		}
		
		FileHandle fh = Gdx.files.internal(strTex);
		if (fh != null)
		{
			texture = new Texture(fh);
			if (texture != null)
			{
				texturecache.put(strTex, texture) ;
			}
		}
		
		return texture;		
	}
}
